﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using DBUtility.PetaPoco;
using Model;

namespace DAL
{
	/// <summary>
    /// 程序应用表 數據訪問類
    /// </summary>
    public class AppDAL : BaseDAL<Model.App>
    {
        /// <summary>
        /// 通過項目名獲得項目
        /// </summary>
        /// <param name="isSuccess">是否成功</param>
        /// <param name="Appname">項目名</param>
        /// <returns></returns>
        public App GetmodelByAppName(out bool isSuccess, string Appname)
        {
            App model = null;
            try
            {
                model=db.FirstOrDefault<App>("where Appname=@0",Appname);
                if (model != null)
                {
                    isSuccess = true;
                }
                else
                {
                    isSuccess = false;
                }
            }
            catch
            {
                isSuccess = false;
            }
            return model;

        }


    }
}
